package easy;

public class Solution_1732 {
    public int largestAltitude(int[] gain) {
        int max = 0;
        for (int i = 0, val = 0; i < gain.length; i++) {
            val = val + gain[i];
            max = Math.max(val, max);
        }
        return max;
    }

    public static void main(String[] args) {
        Solution_1732 model = new Solution_1732();
    }
}
